package run.leven.notice.starter;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import run.leven.notice.starter.model.EmailDetail;
import run.leven.notice.starter.util.NoticeUtils;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.TimeUnit;

/**
 * @author zhengjuntian
 *
 */


@SpringBootApplication
public class NoticeSpringBootStarterApplication {

    public static void main(String[] args) {
        SpringApplication.run(NoticeSpringBootStarterApplication.class, args);
        EmailDetail emailDetail = new EmailDetail();
        emailDetail.setSubject("测试延迟消息rabbit mq starter  20秒");
        emailDetail.setContent("测试延迟消息rabbit mq starter  20秒");
        List<String> list = new ArrayList<>();
        list.add("1140245551@qq.com");
        emailDetail.setToAddressList(list);
        NoticeUtils.sendEmail(emailDetail, 20L, TimeUnit.SECONDS);

        emailDetail.setSubject("测试延迟消息rabbit mq starter  30秒");
        emailDetail.setContent("测试延迟消息rabbit mq starter  30秒");
        NoticeUtils.sendEmail(emailDetail, 30L, TimeUnit.SECONDS);

        emailDetail.setSubject("测试延迟消息rabbit mq starter  40秒");
        emailDetail.setContent("测试延迟消息rabbit mq starter  40秒");
        NoticeUtils.sendEmail(emailDetail, 40L, TimeUnit.SECONDS);
    }

}
